package cn.com.mall.product.web.service.impl;

import cn.com.mall.product.web.service.ICacheService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class CacheServiceImpl implements ICacheService {

    @Cacheable(value = "mycache",key = "#root.methodName")
    @Override
    public Map<String, String> getData() {
        Map<String,String> map=new HashMap<>();
        map.put("a","11111");
        map.put("name","图书");

        return map;
    }

    @CacheEvict(value = "mycache",key = "'getData'")
    @Override
    public void deleteData() {

    }

    @Override
    public void updateData() {

    }


}
